package models

import (
	"gorm.io/gorm"
	"time"
)

type PayRecord struct {
	Id        uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId    uint           `gorm:"column:user_id;type:bigint UNSIGNED;not null;default:0;" json:"user_id"`
	PayTime   time.Time      `gorm:"column:pay_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"pay_time"`
	PayPrice  float64        `gorm:"column:pay_price;type:decimal(10, 2) UNSIGNED;not null;default:0.00;" json:"pay_price"`
	OrderId   uint           `gorm:"column:order_id;type:bigint UNSIGNED;not null;default:0;" json:"order_id"`
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (pr *PayRecord) TableName() string {
	return "pay_record"
}
